package com.example.json;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import java.lang.reflect.Type;
import java.util.List;

public class JsonUtil {
    private static Gson gson=new Gson();
    public static FutureBean[] parseBeanLiat(String json){

        Weather<Bean> result= gson.fromJson(json,Weather.class);

      String res= gson.toJson(result.getResult());
        Bean bean=gson.fromJson(res,Bean.class);

//     String rel= gson.toJson(bean.getResult().getRealtime());
//     RealtimeBean real=gson.fromJson(rel,RealtimeBean.class);

     Type type=new TypeToken<Bean<FutureBean>>(){}.getType();
     Bean<FutureBean> futu=gson.fromJson(res,type);

       return  futu.getFuture();
    }


}
